﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace HR_MapEditor
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            //Application.Run(new Form1());

            //Make the form
            Form1 theForm = new Form1();
            theForm.Show();
            
            //Initialize the form
            theForm.Initialize();

            //Display the form
           // theForm.Show();

            // Store the starting time
            int nNow = System.Environment.TickCount;

            //Start the main program loop

            while (theForm.Running)
            {
                // Calculate the elapsed time between frames
                int nBefore = nNow;
                nNow = System.Environment.TickCount;
                float fElapsedTime = (nNow - nBefore) / 1000.0f;

                theForm.Update(fElapsedTime);
                theForm.Render();
                Application.DoEvents();
            }

            //Terminate the form
            theForm.Terminate();
        }
    }
}
